/*
 * @Author: xiawei 1243162387@qq.com
 * @Date: 2023-12-01 08:02:34
 * @LastEditors: xiawei 1243162387@qq.com
 * @LastEditTime: 2024-05-12 07:41:16
 */
import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import VMdEditor from './VMdEditor ';
import VMdPreview from './VMdPreview';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import 'element-plus/dist/index.css';
import './style.scss';
import VueCustomeComponents from 'vue-custome-components'
import 'vue-custome-components/dist/style.css'
import App from './App.vue';
import router from './router';
const app = createApp(App)
// 引入v-md-editor
app.use(VMdEditor);
app.use(VMdPreview);
// 注册ElementPlus
app.use(ElementPlus, { locale: zhCn } )
app.use(router)
// 开发环境注入本地包
if(import.meta.env.DEV){
  const DevVueCustomeComponents = await import('packages/index')
  app.use(DevVueCustomeComponents.default)
}else{
  app.use(VueCustomeComponents)
}
// 注册 图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }


app.mount('#app')
